use "$dataDir/dataset_wages_imss", clear



		local depvar "daily_wage"
		local age "15-30 30-45 45-60 60-more"
		
	foreach var in `depvar'{
		reghdfe `var' afterXtreatment, abs(id_mills i.year#i.month) vce(cluster id_mills)
		estimates store `var'
		estadd ysumm, mean
		estadd local moyearfe "Yes"
		estadd local millfe "Yes"	
		estadd local cluslvl "Mill"
		estadd local agegroup "All"
	foreach a in `age'{
	reghdfe `var' afterXtreatment if age_2=="`a'", abs(id_mills i.year#i.month) vce(cluster id_mills)
	local agesub=substr("`a'",1,2)
		estimates store `var'_`agesub'
		estadd ysumm, mean
		estadd local moyearfe "Yes"
		estadd local millfe "Yes"	
		estadd local cluslvl "Mill"
		estadd local agegroup "`a'"
	}
	}
		


	esttab daily_wage daily_wage_15 daily_wage_30 daily_wage_45 daily_wage_60 using "$mainDir/tables/TabA3_wages.tex", replace b(%12.3fc) se(%12.5fc) keep(afterXtreatment) varlabels(afterXtreatment  "After 2015 $\times$ Regulated") label starl(* 0.1 ** 0.05 *** 0.01) stats(ymean N moyearfe millfe  cluslvl agegroup, fmt(%9.3fc %12.0fc) label("Mean" "Obs." "Month by Year FE" "Mill FE" "Cluster level" "Age")) nonotes 